package arch.coal.ellipse.security.data;

/**
 * The MSF020 table contains much of the security inforamtion of ELLIPSE.  Most 
 * of the security is based on the characters that make up the profile.
 * @author mblackford
 *
 */
public class MSF020 {
	
	//private String entry_type;	//an 'enum' type
	private Entry_Type entry_type;	//an 'enum' type
	private String entity;
	private String dstrct_code;
	private String default_flag;
	private String pass_word;
	private String security_access;
	private String last_acc_date;
	private String last_mod_date;
	private String creation_date;
	private String global_profile;
	private String employee_id;		//primary key
	private Item profile;			//establishes access rights
	private String owner_id;
	
	public String toString(){
		StringBuffer sb = new StringBuffer();
		sb.append(" MSF020 \n");
		sb.append("    entry_type:[").append(entry_type).append("] \n");
		sb.append("       entity :[").append(entity).append("] \n");
		sb.append("   dstrct_code:[").append(dstrct_code).append("] \n");
		sb.append("  default_flag:[").append(default_flag).append("] \n");
		sb.append("     pass_word:[").append(pass_word).append("] \n");
		sb.append(" last_acc_date:[").append(last_acc_date).append("] \n");
		sb.append(" last_mod_date:[").append(last_mod_date).append("] \n");
		sb.append(" creation_date:[").append(creation_date).append("] \n");
		sb.append("global_profile:[").append(global_profile).append("] \n");
		sb.append("   employee_id:[").append(employee_id).append("] \n");
		sb.append("       profile:[").append(profile.getNameParsed_toString()).append("] \n");
		sb.append("      owner_id:[").append(owner_id).append("] \n");
		
		return sb.toString();
	}


	public String getCreation_date() {
		return creation_date;
	}
	public void setCreation_date(String creation_date) {
		this.creation_date = creation_date;
	}

	public String getDefault_flag() {
		return default_flag;
	}
	public void setDefault_flag(String default_flag) {
		this.default_flag = default_flag;
	}

	public String getDstrct_code() {
		return dstrct_code;
	}
	public void setDstrct_code(String dstrct_code) {
		this.dstrct_code = dstrct_code;
	}

	public String getEmployee_id() {
		return employee_id;
	}
	public void setEmployee_id(String employee_id) {
		this.employee_id = employee_id;
	}

	public String getEntity() {
		return entity;
	}
	public void setEntity(String entity) {
		this.entity = entity;
	}

	public String getGlobal_profile() {
		return global_profile;
	}
	public void setGlobal_profile(String global_profile) {
		this.global_profile = global_profile;
	}

	public String getLast_acc_date() {
		return last_acc_date;
	}
	public void setLast_acc_date(String last_acc_date) {
		this.last_acc_date = last_acc_date;
	}

	public String getLast_mod_date() {
		return last_mod_date;
	}
	public void setLast_mod_date(String last_mod_date) {
		this.last_mod_date = last_mod_date;
	}

	public String getOwner_id() {
		return owner_id;
	}
	public void setOwner_id(String owner_id) {
		this.owner_id = owner_id;
	}

	public String getPass_word() {
		return pass_word;
	}
	public void setPass_word(String pass_word) {
		this.pass_word = pass_word;
	}

	/**
	 * This field is responsible for the access a user will receive in ELLIPSE.
	 * Each charachter in this field represents a specific program module.  The value
	 * of that specific character (0-9) determines if access is allowed and what level.
	 * 
	 * @param profile
	 */
	public Item getProfile() {
		//logger.debug(" leaving ...");
		return profile;
	}
	public void setProfile(Item profile) {
		this.profile = profile;
	}

	public void setProfile(String inString) {
		//logger.debug(" enterring ...");
		Item item = new Item(inString);
		this.profile = item;
	}
	
	public String getSecurity_access() {
		return security_access;
	}
	public void setSecurity_access(String security_access) {
		this.security_access = security_access;
	}
	
	public Entry_Type getEntry_type() {
		return entry_type;
	}
	public void setEntry_type(Entry_Type entry_type) {
		this.entry_type = entry_type;
	}

}
